/*
 * Softmax.h
 *
 *  Created on: 2018��7��31��
 *      Author: wangzhendong
 */

#ifndef REGRESSION_SOFTMAX_H_
#define REGRESSION_SOFTMAX_H_

#include <Regression.h>
#include<Datas.h>
class Softmax: public Regression {
public:
	Softmax(){}
	virtual ~Softmax(){}
	static void setM(int mm){m=mm;}
	static Vec* gra(const Vec &current,Datas* datas,double lamada);
	static double func(const Vec& current,Datas* datas,double lamada);
	virtual void init(){
		Regression::init();
		framework->getGra()->set((Vec* (*)(const Vec&,Datas*,double))&Softmax::gra);
		framework->getFunc()->setF((double (*)(const Vec&,Datas*,double))&Softmax::func);
	}
	Vec* learn(Datas* ds,double lamada);
private:
	/*һ����Ϊ����*/
	static int m;
};

#endif /* REGRESSION_SOFTMAX_H_ */
